package com.xpk.mpstudy.pojo;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@NoArgsConstructor
public class User {
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;
    private String name;
    private int age;
    private String email;


    @TableField(fill= FieldFill.INSERT)
    private Date createTime;


    @TableField(fill=FieldFill.INSERT_UPDATE)
    private Date updateTime;


    @Version
    @TableField(fill = FieldFill.INSERT)
    private Integer version;//版本号，字段-与数据库中的对应

    private int deleted;



    public User(Long id, String name, String email) {
        this.id = id;
        this.name = name;
        this.email = email;
    }
}
